The present invention relates to a recording device which performs recording in accordance with commands transmitted from a host computer, a method of controlling a recording device, a program, and a recording medium.
In the related art, a recording apparatus operates in accordance with commands transmitted from a host computer serving as a higher-level apparatus (for example, see Patent Document 1). The commands that the recording apparatus receives from the host computer include a normal command and an immediate processing command (real-time control command), such as a command of a status return instruction or a reset instruction of the recording apparatus, which has to be processed promptly. For example, when having received data from the host computer, the apparatus described in Patent Document 1 detects a command and an immediate processing command in received data, and a normal command or data related to the normal command is stored in the queue of the receiving buffer and executed in the received order. The immediate processing command is not stored in the receiving buffer and is promptly executed regardless of the received order.
Patent Document 1: JP-A-2001-260435
In the above-described method, for all pieces of received data received from the host computer, it is detected whether or not a command is included in received data each time data is received. When a command is included in received data, it is further determined whether or not the detected command is an immediate processing command. For this reason, for example, when a large quantity of data is collectively transmitted, the above-described command detection processing is performed for all pieces of received data before being stored in the receiving buffer. This command detection processing may become a bottleneck, causing degradation of throughput.
In a general recording apparatus, when it is inappropriate to continue a recording operation, such as when there is no recording medium, such as a sheet, when the cover of the recording apparatus is open, when an error occurs, or the like, the recording operation stops and the interface to the host computer is in the offline state (logical disconnection state), such that maintenance of the recording apparatus and data received from and the host computer, and safety of the user are ensured. The recording apparatus does not perform detection of a command from received data or processing of received data in the offline state. In this case, even when an immediate processing command is included in received data, since the immediate processing command is not detected, there is concern that it is slow in coping with the immediate processing command.